package climit

type RootCommand struct {
	Description string
	Options     []Option
	Expressions []Expression
	Run         func(commandDescriptor CommandDescriptor)
	SubCommands []Command
}

func (receiver *RootCommand) Execute() {
	newRootCommandDefinition(receiver).execute()
}

type Command struct {
	Name        string
	Description string
	Options     []Option
	Expressions []Expression
	Run         func(commandDescriptor CommandDescriptor)
	//SubCommands []Command
}

type Option interface {
	getOptionType() string
}

type BoolOption struct {
	ShortName   string
	LongName    string
	Description string
}

func (receiver BoolOption) getOptionType() string {
	return "bool"
}

type RequiredStringOption struct {
	ShortName    string
	LongName     string
	Description  string
	ValueChecker func(string) (string, bool)
}

func (receiver RequiredStringOption) getOptionType() string {
	return "requiredString"
}

type OptionalStringOption struct {
	ShortName    string
	LongName     string
	Description  string
	DefaultValue string
	ValueChecker func(string) (string, bool)
}

func (receiver OptionalStringOption) getOptionType() string {
	return "optionalString"
}

type RequiredIntOption struct {
	ShortName   string
	LongName    string
	Description string
	Range       func() (min int64, max int64)
}

func (receiver RequiredIntOption) getOptionType() string {
	return "requiredInt"
}

type OptionalIntOption struct {
	ShortName    string
	LongName     string
	Description  string
	DefaultValue int64
	Range        func() (min int64, max int64)
}

func (receiver OptionalIntOption) getOptionType() string {
	return "optionalInt"
}

type RequiredFloatOption struct {
	ShortName   string
	LongName    string
	Description string
	Range       func() (min float64, max float64)
}

func (receiver RequiredFloatOption) getOptionType() string {
	return "requiredFloat"
}

type OptionalFloatOption struct {
	ShortName    string
	LongName     string
	Description  string
	DefaultValue float64
	Range        func() (min float64, max float64)
}

func (receiver OptionalFloatOption) getOptionType() string {
	return "optionalFloat"
}

type Expression interface {
	getExpressionType() string
}

type RequiredExpression struct {
	Name         string
	Description  string
	ValueChecker func(string) (string, bool)
}

func (receiver RequiredExpression) getExpressionType() string {
	return "required"
}

type OptionalExpression struct {
	Name         string
	Description  string
	DefaultValue string
	ValueChecker func(string) (string, bool)
}

func (receiver OptionalExpression) getExpressionType() string {
	return "optional"
}
